<div class="page-container row">
    <form name="form" class="col-sm-6 col-sm-offset-3">
        <h3>源艺密码重置服务</h3>
        <div ng-if="message">
            <div class="alert alert-{{ message.type }}" role="alert">
                <i class="fa fa-info-circle" ng-if="message.type === 'info'"></i>
                <i class="fa fa-warning" ng-if="message.type !== 'info'"></i>
                {{ message.text }}
                <p>系统将于 {{ counter }} 秒钟后返回源艺首页.</p>
            </div>
        </div>
        <div class="form-group" ng-class="{ 'has-error': !form.password.$valid, 'has-success': form.password.$valid }">
            <div class="input-group">
                <span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
                <input type="password" class="form-control" name="password" ng-model="userData.password" placeholder="新密码" required minlength="6">
            </div>
        </div>
        <div class="form-group" ng-class="{ 'has-error': !form.password2.$valid || userData.password !== userData.password2, 'has-success': form.password2.$valid && userData.password === userData.password2 }">
            <div class="input-group">
                <span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
                <input type="password" class="form-control" name="password2" ng-model="userData.password2" placeholder="确认密码" required minlength="6">
            </div>
        </div>
        <div class="form-group">
            <button type="button" class="btn btn-sm" ng-click="toHomepage()">取消</button>
            <button class="btn btn-success btn-sm" busy="reset()" busy-disabled="!form.password.$valid || !form.password2.$valid || userData.password !== userData.password2 || message">确认</button>
        </div>
    </form>
</div>